From ad159aeacba75a16ac4c58e73e8a566dc57b60d3 Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Fri, 25 Feb 2022 00:38:20 +0100
Subject: [PATCH 07/11] fix rustdoc when cross-compiling

---
 src/bootstrap/bin/rustdoc.rs | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs
index 23828f475..993443698 100644
--- a/src/bootstrap/bin/rustdoc.rs
+++ b/src/bootstrap/bin/rustdoc.rs
@@ -27,9 +27,6 @@ fn main() {
         Err(_) => 0,
     };
 
-    let mut dylib_path = dylib_path();
-    dylib_path.insert(0, PathBuf::from(libdir.clone()));
-
     let mut cmd = Command::new(rustdoc);
 
     if target.is_some() {
@@ -42,7 +39,7 @@ fn main() {
     }
 
     cmd.args(&args);
-    cmd.env(dylib_path_var(), env::join_paths(&dylib_path).unwrap());
+    cmd.env(dylib_path_var(), PathBuf::from(libdir.clone()));
 
     // Force all crates compiled by this compiler to (a) be unstable and (b)
     // allow the `rustc_private` feature to link to other unstable crates
@@ -74,7 +71,7 @@ fn main() {
         eprintln!(
             "rustdoc command: {:?}={:?} {:?}",
             dylib_path_var(),
-            env::join_paths(&dylib_path).unwrap(),
+            PathBuf::from(libdir.clone()),
             cmd,
         );
         eprintln!("sysroot: {:?}", sysroot);
-- 
2.39.0

